<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="../plugins/layui/css/myPage.css">
    <style>
        .layui-form-select dl{
            max-height: 300px; //原值为300，调节高度建议为50的倍数
        }
    </style>
</head>
<body  >
<div class="layui-container">


    <form class="layui-form">
        <div class="layui-row">
            <div class="layui-col-md12">

                <fieldset class="layui-elem-field" style="margin-top: 20px;">
                    <legend>添加备注</legend>


                    <div class="layui-form-item">


                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">备注</label>
                            <div class="layui-input-block">
                                <textarea placeholder="请输入内容" class="layui-textarea" name="ydbz"></textarea>
                                <input   type="hidden" name="ydid"    id="ydid"   >
                            </div>
                        </div>






                    </div>






                </fieldset>
            </div>
        </div>


        <button class="layui-btn layui-btn-normal"  lay-submit  lay-filter="new" style="width: 10%; position: absolute;left: 35%"  >立即提交</button>
        <button type="reset" class="layui-btn layui-btn-normal" style="width: 10%; position: absolute;left: 55%" >重置</button>
    </form>
</div>
<script src="../plugins/layui/layui.js"></script>
<script src="../js/config.js"></script>
<script src="../js/jquery.js"></script>
<script src="../js/jquery.md5.js"></script>
<script src="../js/tools.js"></script>

<script>
    layui.use(['table','form','layer','laydate','upload'],function () {
        var table = layui.table;
        var form = layui.form;
        var $ = layui.$;
        var layer = layui.layer;
        var laydate = layui.laydate;
        var currentUser;
        //获取url参数 渲染 权限控制的页面
//        if(getQueryVariable("C") == "false"){
//            $("#new").attr("disabled",true) ;
//            $("#new").addClass("layui-btn-disabled");
//        }






        form.on('submit(new)', function(data){
            console.log(data.field);
            $("textarea").css("border","");
            $.ajax({
                url: contextPath+"/waybill/tjbz",
                type: "put",
                contentType:"application/json;charset=utf-8",
                data: JSON.stringify(data.field) ,
                dataType:"json",
                success: function(res) {
//                    newSuccess($,layer,res)
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    console.log(res);
                    if(res.message == "运单添加备注成功！"){
                        $(".layui-input").val("");
                        layer.msg("运单添加备注成功！",{
                            icon: 1,
                            time: 2000 //2秒关闭（如果不配置，默认是3秒）
                        },function () {
                            parent.layer.close(index);
                        });
                    }else {
                        layer.msg("运单添加备注失败！",{
                            icon: 0,
                            time: 1000, //2秒关闭（如果不配置，默认是3秒）

                        });
                    }

                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });

</script>
</body>
</html>